﻿using UnityEngine;
using System.Collections;

public class Food1LeftMove : MonoBehaviour {

	public float speed;
	public Vector3 posFood;	
	void Start () {
		posFood.x = 3.625785f;
		posFood.y = Random.Range (-3.075894f, 0.9224837f);
		transform.position = posFood;
		rigidbody2D.AddForce (new Vector2(-50, 0));
	}
	
	// Update is called once per frame
	void Update () {
//		Vector3 pos = transform.position;
//		pos.y = (Random.Range(pos.y + 0.005f, pos.y - 0.005f));
//		pos.x -= 0.005f;
//		transform.position = pos;

	}

	void OnTriggerEnter2D(Collider2D collider){
		if (collider.gameObject.tag == "MainFish") {
			Destroy(gameObject);
			
		}
	}
}
